<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>创建一个包含单一数值的计数器实例。</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.counter.counter-class.html">Counter</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.counter.counter-class.getValue.html">Counter::getValue</a></div>
 <div class="up"><a href="internals2.counter.counter-class.html">Counter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="internals2.counter.counter-class.construct" class="refentry">
    <div class="refnamediv">
     <h1 class="refname">Counter::__construct</h1>
     <p class="refpurpose"><span class="refname">Counter::__construct</span> &mdash; <span class="dc-title">
      创建一个包含单一数值的计数器实例。
     </span></p>

    </div>
    <div class="refsect1 description" id="refsect1-internals2.counter.counter-class.construct-description">
     <h3 class="title">说明</h3>
     <div class="constructorsynopsis dc-description">
      <span class="methodname"><strong>Counter::__construct()</strong></span>
       ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
      [, <span class="methodparam"><span class="type">integer</span> <code class="parameter">$initial_value</code></span>
      [, <span class="methodparam"><span class="type">integer</span> <code class="parameter">$flags</code></span>
     ]] )</div>

     <p class="simpara">
      创建一个包含单一数值的 Counter 实例。
     </p>
    </div>

    <div class="refsect1 parameters" id="refsect1-internals2.counter.counter-class.construct-parameters">
     <h3 class="title">参数</h3>
     <dl>

      
       <dt>
name</dt>

       <dd>

        <span class="simpara">
         新计数器的名称。
        </span>
       </dd>

      
      
       <dt>
initial_value</dt>

       <dd>

        <span class="simpara">
         计数器的初始值。默认为零(0)。
        </span>
       </dd>

      
      
       <dt>
flags</dt>

       <dd>

        <span class="simpara">
         新计数器的标志，可在形如
         <em>COUNTER_FLAG_*</em> 的常量中选择。
        </span>
       </dd>

      
     </dl>

    </div>

    <div class="refsect1 returnvalues" id="refsect1-internals2.counter.counter-class.construct-returnvalues">
     <h3 class="title">返回值</h3>
     <p class="simpara">
      成功则返回 Counter 对象。
     </p>
    </div>

    <div class="refsect1 errors" id="refsect1-internals2.counter.counter-class.construct-errors">
     <h3 class="title">错误／异常</h3>
     <p class="simpara">
      <span class="function"><strong>Counter::__construct()</strong></span> 在有错时抛出一个异常(Exception)。
     </p>
    </div>

   </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.counter.counter-class.html">Counter</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.counter.counter-class.getValue.html">Counter::getValue</a></div>
 <div class="up"><a href="internals2.counter.counter-class.html">Counter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
